/* GUI CONVERTED from reopiq01.p (converter v1.75) Sat Aug 12 23:06:39 2000 */
/* reopiq01.p - REPETITIVE                                                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* web convert reopiq01.p (converter v1.00) Fri Oct 10 13:57:58 1997 */
/* web tag in reopiq01.p (converter v1.00) Mon Oct 06 14:18:37 1997 */
/*F0PN*/ /*K0SQ*/ /*V8#ConvertMode=webReport                            */
/*V8:ConvertMode=Report                                              */
/* REVISION: 7.3               LAST MODIFIED: 10/31/94   BY: WUG *GN77*       */
/* REVISION: 7.3               LAST MODIFIED: 12/30/94   BY: cpp *FT95*       */
/* REVISION: 7.3               LAST MODIFIED: 12/11/95   BY: jym *G1FX*       */
/* REVISION: 8.6               LAST MODIFIED: 10/11/97   BY: bvm *K0SQ*       */
/* REVISION: 9.1          LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1          LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */


/* OPERATION HISTORY INQUIRY                                                  */


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

     {mfdtitle.i "b+ "}

     define variable opdate like op_date.
     define variable wolot like wo_lot.
     define variable op like wr_op.
     define variable emp like op_emp.
     define variable type like op_type.
     define variable part like op_part.
     define variable qty like oa_qty.
     define variable ctype as character init "c".
     define variable nullstr as character.

     
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
        
 RECT-FRAME       AT ROW 1 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1 COLUMN 3 NO-LABEL VIEW-AS TEXT SIZE-PIXELS 1 BY 1
 SKIP(.1)  /*GUI*/
wolot        colon 4
        op           colon 25
        opdate       colon 49
        type         colon 68
        part         colon 13
        emp          colon 49
     with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER INITIAL "".
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:HIDDEN in frame a = yes.
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5.  /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



     /* SET EXTERNAL LABELS */
     setFrameLabels(frame a:handle).

/*K0SQ*/ {wbrp01.i}

        repeat:

        if opdate = low_date then opdate = ?.

/*K0SQ*/   if c-application-mode <> 'web':u then
           update wolot op opdate type part emp with frame a editing:

           if frame-field = "wolot" then do:
         {mfnp05.i wo_mstr wo_type_nbr "wo_type = ctype
           and wo_nbr = nullstr"
         wo_lot "input wolot"}

         if recno <> ? then do:
            display wo_lot @ wolot with frame a.
         end.
           end.
           else if frame-field = "part" then do:
         {mfnp05.i wo_mstr wo_type_part "wo_type = ctype"
         wo_part "input part"}

         if recno <> ? then do:
            display wo_part @ part with frame a.
         end.
           end.
           else if frame-field = "emp" then do:
         {mfnp.i emp_mstr emp emp_addr emp emp_addr emp_addr}

         if recno <> ? then do:
            display emp_addr @ emp with frame a.
         end.
           end.
           else do:
         ststatus = stline[3].
         status input ststatus.
         readkey.
         apply lastkey.
           end.
        end.

/*K0SQ*/ {wbrp06.i &command = update &fields = "  wolot op opdate type part emp" &frm = "a"}

/*K0SQ*/ if (c-application-mode <> 'web':u) or
/*K0SQ*/ (c-application-mode = 'web':u and
/*K0SQ*/ (c-web-request begins 'data':u)) then do:



        if opdate = ? then opdate = low_date.

        hide frame b.
        hide frame c.
        hide frame d.
        hide frame e.
        hide frame f.

/*K0SQ*/ end.

           {mfselprt.i "terminal" 80}
/*GUI*/ RECT-FRAME:HEIGHT-PIXELS in frame a = FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.


        if wolot <> "" then
        for each op_hist no-lock
        where op_wo_lot = wolot
        and op_wo_op >= op
        and (op_date >= opdate or opdate = ?)
        and (op_emp = emp or emp = "")
        and (op_part = part or part = "")
        and (op_type = type or type = "")
        and (op_wo_op = op or op = 0)
        use-index op_lot_op,
        each wo_mstr no-lock
        where wo_lot = op_wo_lot and wo_type = "c"
        and wo_nbr = ""
        use-index wo_type_nbr
        with frame b width 80 no-attr-space:
           /* SET EXTERNAL LABELS */
           setFrameLabels(frame b:handle).
           
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


           display
           op_wo_op
           op_part
           op_date
           op_emp
           op_type
/*FT95*        op_trnbr */
/*FT95*/       op_trnbr format ">>>>>>>9"
/*G1FX*/       op_qty_comp
            WITH STREAM-IO /*GUI*/ .
        end.

        else
        if emp <> "" then
        for each op_hist no-lock
        where op_emp = emp
        and (op_date >= opdate or opdate = ?)
        and (op_type = type or type = "")
        and (op_part = part or part = "")
        and (op_wo_op = op or op = 0)
        use-index op_emp,
        each wo_mstr no-lock
        where wo_lot = op_wo_lot and wo_type = "c"
        and wo_nbr = ""
        use-index wo_type_nbr
        with frame c width 80 no-attr-space:
           /* SET EXTERNAL LABELS */
           setFrameLabels(frame c:handle).
           
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


           display
           op_wo_lot
           op_wo_op
           op_part
           op_date
           op_type
/*FT95*        op_trnbr */
/*FT95*/       op_trnbr format ">>>>>>>9"
/*G1FX*/       op_qty_comp
            WITH STREAM-IO /*GUI*/ .
        end.

        else
        if part <> "" then
        for each op_hist no-lock
        where op_part = part
        and (op_date >= opdate or opdate = ?)
        and (op_type = type or type = "")
        and (op_wo_op = op or op = 0)
        use-index op_part,
        each wo_mstr no-lock
        where wo_lot = op_wo_lot and wo_type = "c"
        and wo_nbr = ""
        use-index wo_type_nbr
        with frame d width 80 no-attr-space:
           /* SET EXTERNAL LABELS */
           setFrameLabels(frame d:handle).
           
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


           display
           op_wo_lot
           op_wo_op
           op_date
           op_emp
           op_type
/*FT95*        op_trnbr */
/*FT95*/       op_trnbr format ">>>>>>>9"
/*G1FX*/       op_qty_comp
            WITH STREAM-IO /*GUI*/ .
        end.

        else
        if type <> "" then
        for each op_hist no-lock
        where op_type = type
        and (op_date >= opdate or opdate = ?)
        and (op_wo_op = op or op = 0)
        use-index op_type,
        each wo_mstr no-lock
        where wo_lot = op_wo_lot and wo_type = "c"
        and wo_nbr = ""
        use-index wo_type_nbr
        with frame e width 80 no-attr-space:
           /* SET EXTERNAL LABELS */
           setFrameLabels(frame e:handle).
           
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


           display
           op_wo_lot
           op_wo_op
           op_part
           op_date
           op_emp
/*FT95*        op_trnbr */
/*FT95*/ op_trnbr format ">>>>>>>9"
/*G1FX*/       op_qty_comp
            WITH STREAM-IO /*GUI*/ .
        end.

        else
        for each op_hist no-lock
        where (op_date >= opdate or opdate = ?)
        and (op_wo_op = op or op = 0),
        each wo_mstr no-lock
        where wo_lot = op_wo_lot and wo_type = "c"
        and wo_nbr = ""
        use-index wo_type_nbr
        with frame f width 80 no-attr-space:
           /* SET EXTERNAL LABELS */
           setFrameLabels(frame f:handle).
           
/*GUI*/ {mfguichk.i } /*Replace mfrpchk*/


           display
           op_wo_lot
           op_wo_op
           op_part
           op_date
           op_type
/*FT95*        op_trnbr */
/*FT95*/       op_trnbr format ">>>>>>>9"
/*G1FX*/       op_qty_comp
            WITH STREAM-IO /*GUI*/ .
        end.

        {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

        {mfmsg.i 8 1}
     end.

/*K0SQ*/ {wbrp04.i &frame-spec = a}
